import '@/utils/request'
import service from '@/utils/request'
// eslint-disable-next-line no-unused-vars
import qs from 'qs'
// eslint-disable-next-line no-unused-vars
const { httpPostForm, httpPost, httpGet } = service

// 获取加扣款类型
const getJkkType = params => {
    return httpGet({
        url: '/config/kv/getDicValue1',
        params
    })
}
// 获取加扣款结算列表
const getJkkLs = params => {
    return httpPost({
        url: '/projectsettle/plusDeductionSettlement/listByEntity',
        params
    })
}
// 获取加扣款基础信息
const getJkkInfo = params => {
    return httpGet({
        url: '/projectsettle/plusDeductionSettlement/findById',
        params
    })
}
// 新增加扣款结算
const addJkk = params => {
    return httpPost({
        url: '/projectsettle/plusDeductionSettlement/create',
        params
    })
}
// 修改加扣款结算
const modifyJkk = params => {
    return httpPost({
        url: '/projectsettle/plusDeductionSettlement/update',
        params
    })
}
// 删除加扣款结算
const delJkk = params => {
    return httpGet({
        url: '/projectsettle/plusDeductionSettlement/delete',
        params
    })
}
// 获取工程类加扣款结算明细
const getGcList = params => {
    return httpGet({
        url: '/projectsettle/plusDeductionSettlement/listProjectPlusDeductionDtlsById',
        params
    })
}
// 更新工程加扣款明细
const modifyGcList = params => {
    return httpPost({
        url: '/projectsettle/plusDeductionSettlement/updateProjectPlusDeductionDtls',
        params
    })
}
// 获取工程加扣款明细截止上期末结算金额
const getGcListOfAmount = params => {
    return httpPost({
        url: '/projectsettle/plusDeductionSettlement/listProjectPlusDeductionPreviousTotalAmount',
        params
    })
}
// 获取材料类加扣款结算明细
const getClList = params => {
    return httpGet({
        url: '/projectsettle/plusDeductionSettlement/listMaterialPlusDeductionDtlsById',
        params
    })
}
// 更新材料加扣款明细
const modifyClList = params => {
    return httpPost({
        url: '/projectsettle/plusDeductionSettlement/updateMaterialPlusDeductionDtls',
        params
    })
}
// 获取其它类加扣款结算明细
const getOtherList = params => {
    return httpGet({
        url: '/projectsettle/plusDeductionSettlement/listOtherPlusDeductionDtlsById',
        params
    })
}
// 更新其它加扣款明细
const modifyOtherList = params => {
    return httpPost({
        url: '/projectsettle/plusDeductionSettlement/updateOtherPlusDeductionDtls',
        params
    })
}
// 获取加扣款明细历史结算金额
const getClListHistory = params => {
    return httpPost({
        url: '/projectsettle/plusDeductionSettlement/listHistoricalPlusDeductionPreviousAmount',
        params
    })
}

// 流程接口
const flowCommit = params => {
    return httpPost({
        url: '/projectsettle/flowEngin/commit',
        params
    })
}
const flowAudit = params => {
    return httpPost({
        url: '/projectsettle/flowEngin/audit',
        params
    })
}
const getAuditHistoryLs = params => {
    return httpPost({
        url: '/projectsettle/flowEngin/getAuditHistory',
        params
    })
}
const getCurrentState = params => {
    return httpPost({
        url: '/projectsettle/flowEngin/getCurrentUnitInfo',
        params
    })
}
const flowUndoAudit = params => {
    return httpPost({
        url: '/projectsettle/flowEngin/undoAudit',
        params
    })
}
const flownullify = params => {
    return httpPost({
        url: '/projectsettle/common/nullify',
        params
    })
}
//获取合同当前结算期数
const getNextPeriod = params => {
    return httpGet({
        url: '/projectsettle/plusDeductionSettlement/getNextPeriod',
        params
    })
}
export {
    getJkkType,
    getJkkLs,
    getJkkInfo,
    addJkk,
    modifyJkk,
    delJkk,
    getGcListOfAmount,
    getGcList,
    modifyGcList,
    getClList,
    modifyClList,
    getOtherList,
    modifyOtherList,
    getClListHistory,
    getAuditHistoryLs,
    flowCommit,
    flowAudit,
    getCurrentState,
    flowUndoAudit,
    flownullify,
    getNextPeriod
}
